<template>
	<view>
		<scroll-view>
			<view @click="openContents(item)" class="scroll-view-item" v-for="item in newsList"> 
				<text>{{item.title}}</text>
			</view>
		</scroll-view>
		
	</view>
</template>

<script>
	import { listNews } from '@/api/biz/news'
	
	export default {
		data() {
			return {
				//新闻列表
				newsList:[],
				queryParams:{
					
				}
			}
		},
		onLoad(){
			this.getNewsList()
		},
		methods: {
			getNewsList(){
				listNews(this.queryParams).then(res => {
					console.log(res.rows)
					this.newsList = res.rows;
				})
			},
			openContents(news){
				wx.setStorageSync('news', news);
				wx.navigateTo({
					url:"/pages/news/detail" 
				})
			}
			
		}
	}
</script>

<style scoped>
	
.scroll-view-item{
  height: 100rpx;
  color: dimgrey;
  line-height: 100rpx;
  padding: 2rpx 10rpx;
  border-bottom: 1px solid gray;
}

</style>
